package com.zxk.crawler.pipeline;

import com.zxk.core.common.model.FundAnalysise;
import com.zxk.crawler.service.EsDataHandleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import us.codecraft.webmagic.ResultItems;
import us.codecraft.webmagic.Task;
import us.codecraft.webmagic.pipeline.Pipeline;

/**
 * @author zxk
 * @description 数据pipeline
 * @date 2020/8/28
 */
@Component
public class FundAnalysisePipeline implements Pipeline {

    @Autowired
    private EsDataHandleService esDataHandleService;

    @Override
    public void process(ResultItems resultItems, Task task) {
        FundAnalysise fundAnalysise = resultItems.get("fundAnalysis");

        if(fundAnalysise != null) {
//            this.esDataHandleService.saveFundAnalysise(fundAnalysise);
        }
    }
}
